package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;

import java.util.Objects;

/**
 * 联系人电话判重规则
 *
 * @author feng.zheng
 * @version v1.0
 * @date 2019/1/28 16:33
 * @since v1.0
 */
@Getter
public enum PhoneRepeatRuleEnum {
    /**
     * 联系人电话判重规则
     * 0：不开启判重
     * 1：全局范围判重
     * 2：单个客户判重
     */
    NOT_OPEN(0, "enum.phoneRepeatRule.alias.not_open"),
    GLOBAL_OPEN(1, "enum.phoneRepeatRule.alias.global_open"),
    SINGLE_OPEN(2, "enum.phoneRepeatRule.alias.single_open"),;
    private Integer code;

    private String alias;

    PhoneRepeatRuleEnum(Integer code, String alias) {
        this.code = code;
        this.alias = alias;
    }

    public String getAlias() {
        return I18nMessageUtil.getMessage(alias);
    }
}
